<html>
<head><meta charset="utf-8"><title>inline asm testing · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/inline.20asm.20testing.html">inline asm testing</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="248729429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/inline%20asm%20testing/near/248729429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Timothy Maloney <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/inline.20asm.20testing.html#248729429">(Aug 07 2021 at 18:34)</a>:</h4>
<p>Hello everyone,<br>
I am testing register definitions for the s390x, and was wondering what the comments above all of the functions defined in <code>src/test/assembly/asm/*-types.rs</code> are for. This is an example of a comment/function:</p>
<div class="codehilite"><pre><span></span><code>// mips32: #APP
// mips32: lw $3, %got(extern_func)
// mips32: #NO_APP
#[cfg(mips32)]
#[no_mangle]
pub unsafe fn sym_fn_32() {
    asm!(&quot;lw $v1, {}&quot;, sym extern_func);
}
</code></pre></div>
<p>I am unsure of how the comment above the function relates to it, and am wondering if anyone would mind providing more detail about these functions and how they are used. I am assuming that the comment does something special, because of the way it looks.</p>



<a name="248729705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/inline%20asm%20testing/near/248729705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/inline.20asm.20testing.html#248729705">(Aug 07 2021 at 18:40)</a>:</h4>
<p>I think llvm's filecheck is used for these tests: <a href="https://github.com/rust-lang/rust/blob/57d8747cca741de84918800dca13da0c821e33e0/src/tools/compiletest/src/runtest.rs#L2382">https://github.com/rust-lang/rust/blob/57d8747cca741de84918800dca13da0c821e33e0/src/tools/compiletest/src/runtest.rs#L2382</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>